package cn.tedu.carehome.foundation.controller;

import cn.tedu.carehome.foundation.pojo.dto.RoomDTO;
import cn.tedu.carehome.foundation.service.IRoomService;
import cn.tedu.carehome.foundation.web.JsonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/room")
@Validated
@Slf4j
@Api(tags = "床位分配")
public class RoomController {
    @Autowired
    IRoomService roomService;

    @ApiOperation("分配床位")
    @PostMapping("/add-new")
    public JsonResult<Void> addnew(RoomDTO roomDTO)
    {
        roomService.addnew(roomDTO);
        return JsonResult.ok();
    }
}
